package com.ms.p2p.provider;



import com.ms.common.exception.NoticeException;
import com.ms.p2p.bean.PageBean;
import com.ms.p2p.entity.member.Member;

import java.util.List;
import java.util.Map;

public interface MemberProvider {

    public int updateById(Member member);

    public void updateMobilePhoneById(String mobilePhone, Integer id) ;

    /**
     * 插入一条数据（部分字段）并返回主键
     *
     * @return 主键
     */

    public int insertAndReturnKey(Member member) ;
    /**
     * 根据ID查询一条用户数据
     *
     * @param userId 用户ID
     * @return User对象
     */
    public Member findById(int userId);

    /**
     * 根据用户名查询一条用户数据
     *
     * @return User对象
     */
    public Member findByUserName(String userName) ;

    /**
     * 根据手机号查询一条数据
     *
     * @param mobilePhone
     * @return User对象
     */
    public Member findByMobilePhone(String mobilePhone);

    /**
     * 根据email号查询一条数据
     *
     * @return User对象
     */
    public Member findByEmail(String email);
    /**
     * 根据用户名或手机号或Email查询一条数据
     *
     * @return User对象
     */
    public Member findByUserNameOrMobilePhoneOrEmail(String str);

    public List<Map<String, Object>> findPager(String userId, String userName, String kefuname, String email, String mobilePhone, String begin_date, String end_date, String ru_userId, String ru_userName, String ru_mobilePhone, PageBean page);


    public List<Map<String, Object>> findAll(String userId, String userName, String kefuname, String email, String mobilePhone, String begin_date, String end_date, String ru_userId, String ru_userName, String ru_mobilePhone) ;

    public int findCount(String userId, String userName, String kefuname, String email, String mobilePhone, String begin_date, String end_date, String ru_userId, String ru_userName, String ru_mobilePhone);
    /**
     * @return int 返回类型
     * @Title: countAllUser
     * @Description: 累计客户数
     */

    public int countAllUser();


    public int countAllUserTender();


    public int update(Member member) ;

    public int updatePayPwd(String pwd, int id) ;
    /**
     * 查询出单个用户推荐的注册用户的个数
     *
     * @param recommend_id
     * @return
     */
    public int findMyRecommendCount(Integer recommend_id);


    public int findNotUserIdAndEmail(Integer id, String email);
    /**
     * 更新客服
     */
    public int updateKefuByid(Integer user_id, String kefu_id) ;



    public Member register(Member user) throws NoticeException;
}
